package com.example.apigateway.Interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2018-06-28
 **/
@Configuration
public class WebMvcConf extends WebMvcConfigurerAdapter {

    @Autowired
    private AuthInterceptor authInterceptor;

    @Autowired
    private AuthActionInterceptor authActionInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authInterceptor).excludePathPatterns("/static").excludePathPatterns("/test/*").addPathPatterns("/**");
        registry.addInterceptor(authActionInterceptor).addPathPatterns("/house/toAdd");

        super.addInterceptors(registry);
    }
}